import hashlib

class MyMD5:
    def __init__(self, salt=b'123456'):
        self.salt = salt

    def encrypt(self, text):
        if not text:
            return None
        # salt是盐值，默认是123456
        md5 = hashlib.md5()
        md5.update(self.salt)
        md5.update(text.encode(encoding='UTF-8'))
        md5_result = md5.hexdigest()
        return md5_result